package cpa.prowon;

import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.widgets.Display;

/**
 * The Util class provides functionality to handle the clipboard and might
 * be enhanced in the future to handle additional functionality
 * @author Chris
 */
public class Util {

	// Properties
	protected static Clipboard clipboard;
	
	/**
	 * Return the clipboard that can be used to share objects or information with other applications
	 * @return The Clipboard object
	 * @author Chris
	 */
	public static Clipboard getClipboard() {
		
		// If the clipboard was not initialized yet, do it
		if (clipboard == null) {
			clipboard = new Clipboard(Display.getCurrent());
		}
		
		// Return the clipboard
		return clipboard;
		
	}
	
	/**
	 * The constructor is protected, because the Util class provides static
	 * functionality only and is not intended to be instantiated
	 * @author Chris
	 */
	protected Util() {
		super();
	}

}
